#include <iostream>
#include "TcpServer.hpp"
#include "Http.hpp"

void Usage(string proc)
{
    cout << "Usage:" << proc << "server-port" << endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        return 1;
    }
    uint16_t port = stoi(argv[1]);
    HttpServer httpserver;
    TcpServer tcpsvr(port, bind(&HttpServer::HandlerHttpRequest, &httpserver, placeholders::_1));
    tcpsvr.Loop();
    return 0;
}